<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <link type="text/css" rel="stylesheet" href="../css/all.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
</head>
<body id="Ibody">
<!--
	制作：陈道祥
	页面：过程设备
	更新：九哥
-->





<!-----------工厂设备页面---------->
<div class="stepTwo" id="IstepTenFactoryCompanyDevice">
    <div class="companyHeadPanel">
        <div class="companyHeadOne">您工厂生产设备是：（点击多选）</div>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="blankSpace"></div>
    <div class="modelPanel">
        <div class="goodsPanel">
            <div class="deviceName">设备</div>
            <div class="deviceInner">品牌</div>
            <div class="deviceInner">年限</div>
            <div class="deviceInner">数量</div>
            <div class="deviceOuter">打钩</div>
        </div>
        <span id="equipSpan"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="companyRemark">备注：方便你的客户找到你、招聘的员工找到你、了解你、信任你，图片尽量上传完善。让客户多了解自己，容易接单成功。细节决定成败，图片清晰。</div>
    <div class="nextStepDiv">
        <!--<span class="prevStep" id="facEquipPre">上一步</span>-->
        <!--<span class="nextStep" id="facEquipNext">下一步</span>-->
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<!-----------工厂设备页面---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<script type="text/javascript" src="../js/loginFac.js"></script>
<script>
    (function(){
        getFacEquipList();
        H5.TitleBar.create("工厂设备")
    })();
    /**
     * 设置保存
     * */
    function setSave(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo == 'undefined' || userInfo.token == 'undefined') {
            getErrMsg('没有登录！',''); return;
        }
        var equipIdStr = $('#equipIdStr').val();
        var equipIds = equipIdStr.split('-');
        var equips = new Array();
        for (var i=0;i<equipIds.length;i++) {
            equips[i] = [
                equipIds[i],
                $('#brand-'+equipIds[i]).val(),
                $('#year-'+equipIds[i]).val(),
                $('#num-'+equipIds[i]).val(),
                $('#equip-'+equipIds[i]).val()
            ];
        }
        var data = {
            app_access: app_access,
            token: userInfo.token,
            type: userInfo.type,
            cate: userInfo.cate,
            equips:JSON.stringify(equips)
        };
        //console.log(equips); return;
        $.ajax({
            type:'post',
            url:getDomain() + 'fac-equip-set',
            data:data,
            success:function(res){
                //console.log(res); return;
                if (res.code != 0) {
                    getErrMsg(res.msg,''); return;
                }
//                var facEquipArray = []
//                $('.modelPanel input').each(function () {
//                    if ($(this).prop('checked')) {
//                        facEquipArray.push(0)
//                    }
//                })
//                var facEquip = ''
//                if (facEquipArray.length > 0) {
//                    facEquip = true
//                } else {
//                    facEquip = false
//                }
//                cacheSet('facEquip', facEquip);
                console.log(res);
                window.location.href = '/h5/login/facList.html';
            },
            error:function(){
                getErrMsg('操作失败！',''); return;
            }
        });
    }
</script>
</html>